home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / dbcgrids.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  8.9 KB  |  232 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1998 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'DBCGrids.pas' rev: 3.00
  6.  
  7. #ifndef DBCGridsHPP
  8. #define DBCGridsHPP
  9. #include <Db.hpp>
  10. #include <Menus.hpp>
  11. #include <Graphics.hpp>
  12. #include <Forms.hpp>
  13. #include <Controls.hpp>
  14. #include <Classes.hpp>
  15. #include <Messages.hpp>
  16. #include <Windows.hpp>
  17. #include <SysUtils.hpp>
  18. #include <SysInit.hpp>
  19. #include <System.hpp>
  20.  
  21. //-- user supplied -----------------------------------------------------------
  22.  
  23. namespace Dbcgrids
  24. {
  25. //-- type declarations -------------------------------------------------------
  26. class DELPHICLASS TDBCtrlGridLink;
  27. class DELPHICLASS TDBCtrlGrid;
  28. class DELPHICLASS TDBCtrlPanel;
  29. class PASCALIMPLEMENTATION TDBCtrlPanel : public Controls::TWinControl 
  30. {
  31.     typedef Controls::TWinControl inherited;
  32.     
  33. private:
  34.     TDBCtrlGrid* FDBCtrlGrid;
  35.     HIDESBASE MESSAGE void __fastcall CMControlListChange(Controls::TCMControlListChange &Message);
  36.     HIDESBASE MESSAGE void __fastcall WMEraseBkgnd(Messages::TMessage &Message);
  37.     HIDESBASE MESSAGE void __fastcall WMPaint(Messages::TWMPaint &Message);
  38.     HIDESBASE MESSAGE void __fastcall WMNCHitTest(Messages::TWMNCHitTest &Message);
  39.     
  40. protected:
  41.     virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
  42.     virtual void __fastcall PaintWindow(HDC DC);
  43.     
  44. public:
  45.     __fastcall TDBCtrlPanel(TDBCtrlGrid* DBCtrlGrid);
  46. public:
  47.     /* TWinControl.Create */ __fastcall virtual TDBCtrlPanel(Classes::TComponent* AOwner) : Controls::TWinControl(
  48.         AOwner) { }
  49.     /* TWinControl.CreateParented */ __fastcall TDBCtrlPanel(HWND ParentWindow) : Controls::TWinControl(
  50.         ParentWindow) { }
  51.     /* TWinControl.Destroy */ __fastcall virtual ~TDBCtrlPanel(void) { }
  52.     
  53. };
  54.  
  55. enum TDBCtrlGridOrientation { goVertical, goHorizontal };
  56.  
  57. enum TDBCtrlGridBorder { gbNone, gbRaised };
  58.  
  59. typedef void __fastcall (__closure *TPaintPanelEvent)(TDBCtrlGrid* DBCtrlGrid, int Index);
  60.  
  61. enum TDBCtrlGridKey { gkNull, gkEditMode, gkPriorTab, gkNextTab, gkLeft, gkRight, gkUp, gkDown, gkScrollUp, 
  62.     gkScrollDown, gkPageUp, gkPageDown, gkHome, gkEnd, gkInsert, gkAppend, gkDelete, gkCancel };
  63.  
  64. class PASCALIMPLEMENTATION TDBCtrlGrid : public Controls::TWinControl 
  65. {
  66.     typedef Controls::TWinControl inherited;
  67.     
  68. private:
  69.     TDBCtrlGridLink* FDataLink;
  70.     TDBCtrlPanel* FPanel;
  71.     Graphics::TCanvas* FCanvas;
  72.     int FColCount;
  73.     int FRowCount;
  74.     int FPanelWidth;
  75.     int FPanelHeight;
  76.     int FPanelIndex;
  77.     int FPanelCount;
  78.     int FBitmapCount;
  79.     HBITMAP FPanelBitmap;
  80.     HBITMAP FSaveBitmap;
  81.     HDC FPanelDC;
  82.     TDBCtrlGridOrientation FOrientation;
  83.     TDBCtrlGridBorder FPanelBorder;
  84.     bool FAllowInsert;
  85.     bool FAllowDelete;
  86.     bool FShowFocus;
  87.     bool FFocused;
  88.     bool FClicking;
  89.     bool FSelColorChanged;
  90.     int FScrollBarKind;
  91.     Graphics::TColor FSelectedColor;
  92.     TPaintPanelEvent FOnPaintPanel;
  93.     bool __fastcall AcquireFocus(void);
  94.     void __fastcall AdjustSize(void);
  95.     void __fastcall CreatePanelBitmap(void);
  96.     void __fastcall DataSetChanged(bool Reset);
  97.     void __fastcall DestroyPanelBitmap(void);
  98.     void __fastcall DrawPanel(HDC DC, int Index);
  99.     void __fastcall DrawPanelBackground(HDC DC, const Windows::TRect &R, bool Erase, bool Selected);
  100.     Controls::TWinControl* __fastcall FindNext(Controls::TWinControl* StartControl, bool GoForward, int 
  101.         &WrapFlag);
  102.     Db::TDataSource* __fastcall GetDataSource(void);
  103.     bool __fastcall GetEditMode(void);
  104.     Windows::TRect __fastcall GetPanelBounds(int Index);
  105.     bool __fastcall PointInPanel(const Windows::TSmallPoint P);
  106.     void __fastcall Reset(void);
  107.     void __fastcall Scroll(int Inc, bool ScrollLock);
  108.     void __fastcall ScrollMessage(Messages::TWMScroll &Message);
  109.     HIDESBASE void __fastcall SelectNext(bool GoForward);
  110.     void __fastcall SetColCount(int Value);
  111.     void __fastcall SetDataSource(Db::TDataSource* Value);
  112.     void __fastcall SetEditMode(bool Value);
  113.     void __fastcall SetOrientation(TDBCtrlGridOrientation Value);
  114.     void __fastcall SetPanelBorder(TDBCtrlGridBorder Value);
  115.     void __fastcall SetPanelHeight(int Value);
  116.     void __fastcall SetPanelIndex(int Value);
  117.     void __fastcall SetPanelWidth(int Value);
  118.     void __fastcall SetRowCount(int Value);
  119.     void __fastcall SetSelectedColor(Graphics::TColor Value);
  120.     void __fastcall UpdateDataLinks(Controls::TControl* Control, bool Inserting);
  121.     void __fastcall UpdateScrollBar(void);
  122.     HIDESBASE MESSAGE void __fastcall WMLButtonDown(Messages::TWMMouse &Message);
  123.     HIDESBASE MESSAGE void __fastcall WMLButtonDblClk(Messages::TWMMouse &Message);
  124.     HIDESBASE MESSAGE void __fastcall WMHScroll(Messages::TWMScroll &Message);
  125.     HIDESBASE MESSAGE void __fastcall WMVScroll(Messages::TWMScroll &Message);
  126.     HIDESBASE MESSAGE void __fastcall WMEraseBkgnd(Messages::TMessage &Message);
  127.     HIDESBASE MESSAGE void __fastcall WMPaint(Messages::TWMPaint &Message);
  128.     HIDESBASE MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Message);
  129.     HIDESBASE MESSAGE void __fastcall WMKillFocus(Messages::TWMKillFocus &Message);
  130.     MESSAGE void __fastcall WMGetDlgCode(Messages::TWMNoParams &Message);
  131.     HIDESBASE MESSAGE void __fastcall WMSize(Messages::TMessage &Message);
  132.     HIDESBASE MESSAGE void __fastcall CMChildKey(Controls::TCMChildKey &Message);
  133.     HIDESBASE MESSAGE void __fastcall CMColorChanged(Messages::TMessage &Message);
  134.     
  135. protected:
  136.     virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
  137.     virtual void __fastcall CreateWnd(void);
  138.     DYNAMIC Classes::TComponent* __fastcall GetChildParent(void);
  139.     DYNAMIC void __fastcall GetChildren(Classes::TGetChildProc Proc, Classes::TComponent* Root);
  140.     virtual void __fastcall PaintPanel(int Index);
  141.     virtual void __fastcall PaintWindow(HDC DC);
  142.     virtual void __fastcall ReadState(Classes::TReader* Reader);
  143.     virtual void __fastcall SetBounds(int ALeft, int ATop, int AWidth, int AHeight);
  144.     __property TDBCtrlPanel* Panel = {read=FPanel};
  145.     
  146. public:
  147.     __fastcall virtual TDBCtrlGrid(Classes::TComponent* AOwner);
  148.     __fastcall virtual ~TDBCtrlGrid(void);
  149.     void __fastcall DoKey(TDBCtrlGridKey Key);
  150.     DYNAMIC void __fastcall GetTabOrderList(Classes::TList* List);
  151.     DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
  152.     __property Graphics::TCanvas* Canvas = {read=FCanvas};
  153.     __property bool EditMode = {read=GetEditMode, write=SetEditMode, nodefault};
  154.     __property int PanelCount = {read=FPanelCount, nodefault};
  155.     __property int PanelIndex = {read=FPanelIndex, write=SetPanelIndex, nodefault};
  156.     
  157. __published:
  158.     __property Align ;
  159.     __property bool AllowDelete = {read=FAllowDelete, write=FAllowDelete, default=1};
  160.     __property bool AllowInsert = {read=FAllowInsert, write=FAllowInsert, default=1};
  161.     __property int ColCount = {read=FColCount, write=SetColCount, nodefault};
  162.     __property Color ;
  163.     __property Db::TDataSource* DataSource = {read=GetDataSource, write=SetDataSource};
  164.     __property DragCursor ;
  165.     __property DragMode ;
  166.     __property Enabled ;
  167.     __property Font ;
  168.     __property TDBCtrlGridOrientation Orientation = {read=FOrientation, write=SetOrientation, default=0
  169.         };
  170.     __property TDBCtrlGridBorder PanelBorder = {read=FPanelBorder, write=SetPanelBorder, default=1};
  171.     __property int PanelHeight = {read=FPanelHeight, write=SetPanelHeight, nodefault};
  172.     __property int PanelWidth = {read=FPanelWidth, write=SetPanelWidth, nodefault};
  173.     __property ParentColor ;
  174.     __property ParentFont ;
  175.     __property ParentShowHint ;
  176.     __property PopupMenu ;
  177.     __property TabOrder ;
  178.     __property TabStop ;
  179.     __property int RowCount = {read=FRowCount, write=SetRowCount, nodefault};
  180.     __property Graphics::TColor SelectedColor = {read=FSelectedColor, write=SetSelectedColor, stored=FSelColorChanged
  181.         , default=-2147483643};
  182.     __property bool ShowFocus = {read=FShowFocus, write=FShowFocus, default=1};
  183.     __property ShowHint ;
  184.     __property Visible ;
  185.     __property OnClick ;
  186.     __property OnDblClick ;
  187.     __property OnDragDrop ;
  188.     __property OnDragOver ;
  189.     __property OnEndDrag ;
  190.     __property OnEnter ;
  191.     __property OnExit ;
  192.     __property OnKeyDown ;
  193.     __property OnKeyPress ;
  194.     __property OnKeyUp ;
  195.     __property OnMouseDown ;
  196.     __property OnMouseMove ;
  197.     __property OnMouseUp ;
  198.     __property TPaintPanelEvent OnPaintPanel = {read=FOnPaintPanel, write=FOnPaintPanel};
  199.     __property OnStartDrag ;
  200. public:
  201.     /* TWinControl.CreateParented */ __fastcall TDBCtrlGrid(HWND ParentWindow) : Controls::TWinControl(
  202.         ParentWindow) { }
  203.     
  204. };
  205.  
  206. class PASCALIMPLEMENTATION TDBCtrlGridLink : public Db::TDataLink 
  207. {
  208.     typedef Db::TDataLink inherited;
  209.     
  210. private:
  211.     TDBCtrlGrid* FDBCtrlGrid;
  212.     
  213. protected:
  214.     virtual void __fastcall ActiveChanged(void);
  215.     virtual void __fastcall DataSetChanged(void);
  216.     
  217. public:
  218.     __fastcall TDBCtrlGridLink(TDBCtrlGrid* DBCtrlGrid);
  219. public:
  220.     /* TDataLink.Destroy */ __fastcall virtual ~TDBCtrlGridLink(void) { }
  221.     
  222. };
  223.  
  224. //-- var, const, procedure ---------------------------------------------------
  225.  
  226. }    /* namespace Dbcgrids */
  227. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  228. using namespace Dbcgrids;
  229. #endif
  230. //-- end unit ----------------------------------------------------------------
  231. #endif    // DBCGrids
  232.